/*
 * FirstRunDialog.java
 *
 * Created on 8. červenec 2008, 8:46
 */

package scubalogbook;

/**
 *
 * @author  vkorecky
 */
public class FirstRunDialog extends javax.swing.JDialog {

    ScubaLogbookView mainWindow = null;
    
    /** Creates new form FirstRunDialog */
    public FirstRunDialog(ScubaLogbookView mainWindow, boolean modal) {        
        super(mainWindow.getFrame(), modal);
        this.mainWindow = mainWindow;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel = new javax.swing.JPanel();
        label = new javax.swing.JLabel();
        openProfileButton = new javax.swing.JButton();
        newProfileButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        panel.setName("panel"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(scubalogbook.ScubaLogbookApp.class).getContext().getResourceMap(FirstRunDialog.class);
        label.setFont(resourceMap.getFont("label.font")); // NOI18N
        label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        label.setText(resourceMap.getString("label.text")); // NOI18N
        label.setName("label"); // NOI18N

        openProfileButton.setText(resourceMap.getString("openProfileButton.text")); // NOI18N
        openProfileButton.setName("openProfileButton"); // NOI18N
        openProfileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openProfileButtonActionPerformed(evt);
            }
        });

        newProfileButton.setText(resourceMap.getString("newProfileButton.text")); // NOI18N
        newProfileButton.setName("newProfileButton"); // NOI18N
        newProfileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newProfileButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(panel);
        panel.setLayout(panelLayout);
        panelLayout.setHorizontalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelLayout.createSequentialGroup()
                        .addComponent(openProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 148, Short.MAX_VALUE)
                        .addComponent(newProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(label, javax.swing.GroupLayout.PREFERRED_SIZE, 448, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        panelLayout.setVerticalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLayout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .addComponent(label)
                .addGap(18, 18, 18)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(openProfileButton)
                    .addComponent(newProfileButton))
                .addGap(23, 23, 23))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void openProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openProfileButtonActionPerformed
    mainWindow.DisplayOpenProfileWindow();
    this.dispose();    
}//GEN-LAST:event_openProfileButtonActionPerformed

private void newProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newProfileButtonActionPerformed
    mainWindow.DisplayNewProfileWindow();
    this.dispose();
}//GEN-LAST:event_newProfileButtonActionPerformed
  

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel label;
    private javax.swing.JButton newProfileButton;
    private javax.swing.JButton openProfileButton;
    private javax.swing.JPanel panel;
    // End of variables declaration//GEN-END:variables

}
